package com.itheima.test02;

import java.util.Objects;

public class Demo {

    public static void main(String[] args) {
        //equals
        Student student = new Student("zhangsan",18);
        Student student2 = new Student("zhangsan",18);
        boolean equals = student.equals(student2);
        System.out.println(equals);

        //Objects

        String s = Objects.toString(student);
        System.out.println(s);
        student=null;
        String s1= Objects.toString(student, "默认值");
        System.out.println(s1);

        System.out.println(Objects.isNull(student));
        System.out.println(Objects.nonNull(student));


    }
}
